// 窗口的基础配置
import { join } from 'path'
import { is } from '@electron-toolkit/utils'
import icon from '../../../resources/chat-logo.png?asset'

// 获取正确的 preload 路径
const preloadPath = is.dev 
  ? join(process.cwd(), 'preload/index.js')  // 开发环境
  : join(process.resourcesPath, 'preload/index.js')  // 生产环境

export const defaultWindowConfig = {
  show: false,
  autoHideMenuBar: true,
  icon: icon,
  webPreferences: {
    preload: preloadPath,
    sandbox: false,
    webSecurity: true,
    contextIsolation: true,
    nodeIntegration: false
  }
}

// 各窗口的特定配置
export const windowConfig = {
  login: {
    width: 900,
    height: 670,
    ...defaultWindowConfig
  },
  chat: {
    width: 1000,
    height: 700,
    ...defaultWindowConfig
  },
  admin: {
    width: 1200,
    height: 800,
    ...defaultWindowConfig
  }
} 